/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import 'nib'

sidebar-width = 250px
sidebar-width-small = 160px

html
  height: 100%

body
  height: 100%

#main
  height: 100%

.gutter
  background-color: transparent
  background-repeat: no-repeat
  background-position: 50%

.gutter-vertical
  cursor: row-resize
  background-image: url('../images/grips/horizontal.png')


#sidebar
  overflow: hidden
  position: fixed
  left: - sidebar-width
  top: 0
  bottom: 0
  height: 100%
  width: sidebar-width
  background: rgba(21,21,21,1)
  // background: linear-gradient(200deg, 0% rgba(31,31,31,1), 100% rgba(0,0,0,1))
  transition(400ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all)
  box-shadow(inset -10px 0px 10px rgba(0,0,0,0.2))

  &.sidebar-visible
    left: 0

  .logo
    width: auto
    height: 22px
    img
      display: inline-block

  .navbar-static-top
    overflow: hidden
    height: 51px
    .navbar-header
      width: 100%

  .navbar-brand.navbar-brand-text
    font-size: 14px
    font-weight: bold
    color: #ffffff
    padding-left: 0

  .nav > li > a
    color: #aaaaaa
    margin-bottom: 1px

    &:hover, &:focus
      background-color: rgba(40, 40, 40, 0.5)
    &.active
      background-color: rgba(100, 100, 100, 0.5)

#content
  background-color: #ffffff
  margin-left: 0
  padding-top: 70px
  height: 100%

  transition(400ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all)

  .navbar-main, .navbar-main-additional
    transition(400ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all)

  .navbar-main-additional
    margin-top: 51px
    border-bottom: none
    padding: 0 20px
    .nav-tabs
      margin: 0 -20px
      padding: 0 20px

  .navbar-secondary-additional
    border: none
    padding: 0 20px
    margin-bottom: 0
    .nav-tabs
      margin: 0 -20px

  &.sidebar-visible
    margin-left: sidebar-width

    .navbar-main, .navbar-main-additional
      left: sidebar-width

  #fold-button
    display: inline-block
    margin-left: 20px

  #content-inner
    padding: 0px 20px 20px 20px
    &.has-navbar-main-additional
      padding-top: 42px

.page-header
  margin: 0 0 20px 0

.nav
  > li
    > a, > a:hover, > a:focus
      color: #aaaaaa
      background-color: transparent
      border-bottom: 2px solid transparent

    &.active
      > a, > a:hover, > a:focus
        color: #000000
        border-bottom: 2px solid #000000

  &.nav-tabs
    margin-bottom: 20px

.table
  .table
    background-color: transparent

  th
    font-weight: normal
    color: #999999

  td.td-long
    width: 20%
    white-space: pre-wrap
    white-space: -moz-pre-wrap
    white-space: -pre-wrap
    white-space: -o-pre-wrap
    word-wrap: break-word

  &.table-clickable
    tr
      cursor: pointer

  &.table-inner
    background-color: transparent

  &.table-properties
    table-layout: fixed
    white-space: nowrap
    td
      width: 50%
      white-space: nowrap
      overflow: hidden
      text-overflow: ellipsis

  &.table-body-hover
    > tbody
      border-top: none
      border-left: 2px solid transparent
      &.active
        border-left: 2px solid #000000
      &:hover, &.active
        td:not(.tab-column)
          background-color: #f0f0f0
        td.tab-column li.active
          background-color: #f0f0f0

  &.table-activable
    th.tab-column, td.tab-column
      border-top: none
      width: 47px

    td.tab-column
      border-right: 1px solid #dddddd

    td
      position: relative

  &.table-no-border
    th
      border-top: none !important
    td
      border-top: none !important

  &#job-submit-table
    table-layout: fixed
    white-space: nowrap
    td.td-large
      width: 40%
    td
      width: 15%
      > input
        height: 28px
        font-size: 14px
      > span.btn
        padding: 2px 4px
        font-size: 14px

  &#add-file-table
    table-layout: fixed

    span.btn
      position: relative
      overflow: hidden
      padding: 2px 4px
      font-size: 14px
      border-radius: 2px
      margin-top: -3px

    td#add-file-button
      width: 100px

      input[type=file]
        position: absolute
        top: 0
        right: 0
        min-width: 100%
        min-height: 100%
        filter: unquote("alpha(opacity=0)")
        opacity: 0
        outline: none
        cursor: inherit
        display: block

    td#add-file-name
      width: 250px
      text-overflow: ellipsis
      overflow: hidden
      white-space: nowrap

    td#add-file-status
      width: 100%

      span.btn-progress-bar
        padding: 0 !important
        width: 100%
        background-color: #f5f5f5
        text-align: left
      span.btn-progress
        padding: 2px 2px
        font-size: 10px


  span.error-area
    color: red

  span.row-button
    padding: 1px 2px
    margin: 0
    border: none !important

  .small-label
    text-transform: uppercase
    font-size: 13px
    color: #999999

span.icon-wrapper
  width: 1.2em
  display: inline-block

.panel
  &.panel-dashboard
    .huge
      font-size: 28px

  &.panel-lg
    font-size: 16px
    .badge
      font-size: 14px

.navbar-secondary
  overflow: auto

.navbar-main, .navbar-secondary, .navbar-main-additional, .panel.panel-multi, .navbar-secondary-additional
  .navbar-title, .navbar-title-job, .panel-title
    float: left
    font-size: 18px
    padding: 12px 20px 13px 10px
    color: #333333
    display: inline-block

  .navbar-info, .panel-info
    float: left
    font-size: 14px
    padding: 15px 15px 15px 15px
    color: #999999
    display: inline-block
    border-right: 1px solid #e7e7e7
    overflow: hidden

    .overflow
      position: absolute
      display: block
      text-overflow: ellipsis
      overflow: hidden
      height: 22px
      line-height: 22px
      vertical-align: middle

    &.first
      border-left: 1px solid #e7e7e7
    &.last
      border-right: none

.panel.panel-multi
  .panel-heading
    padding: 0

    .panel-info
      &.thin
        padding: 8px 10px

  .panel-body
    padding: 10px
    background-color: #fdfdfd
    color: #999
    font-size: 13px

    &.clean
      color: inherit
      font-size: inherit

.navbar-main-additional, .navbar-secondary-additional
  min-height: 40px
  background-color: #fdfdfd

  .navbar-info
    font-size: 13px
    padding: 10px 15px 10px 15px

.nav-top-affix
  &.affix
    width: 100%
    top: 50px
    margin-left: -20px
    padding-left: 20px
    margin-right: -20px
    padding-right: 20px
    background-color: #fff
    z-index: 1


.badge-default[href]:hover,
.badge-default[href]:focus
  background-color #808080

.badge-primary
  background-color #428bca

.badge-primary[href]:hover,
.badge-primary[href]:focus
  background-color #3071a9

.badge-success
  background-color #5cb85c

.badge-success[href]:hover,
.badge-success[href]:focus
  background-color #449d44

.badge-info
  background-color #5bc0de

.badge-info[href]:hover,
.badge-info[href]:focus
  background-color #31b0d5

.badge-warning
  background-color #f0ad4e

.badge-warning[href]:hover,
.badge-warning[href]:focus
  background-color #ec971f

.badge-danger
  background-color #d9534f

.badge-danger[href]:hover,
.badge-danger[href]:focus
  background-color #c9302c


.indicator
  display: inline-block
  margin-right: 15px
  &.indicator-primary
    color: #428bca

  &.indicator-success
    color: #5cb85c

  &.indicator-info
    color: #5bc0de

  &.indicator-warning
    color: #f0ad4e

  &.indicator-danger
    color: #d9534f

pre.exception
  border: none
  background-color: transparent
  padding: 0
  margin: 0

pre
  white-space: pre-wrap
  white-space: -moz-pre-wrap
  white-space: -pre-wrap
  white-space: -o-pre-wrap
  word-wrap: break-word

.nav-tabs
  &.tabs-vertical
    // float: right
    position: absolute
    left: 0
    top: 0
    border-bottom: none
    // border-right: 1px solid #dddddd
    z-index: 100
    li
      float: none
      margin-bottom: 0
      margin-right: -1px

      > a
        margin-right: 0
        border-radius(0)
        border-bottom: none
        border-left: 2px solid transparent

      > a:hover, > a:focus
        border-bottom: none
        border-left: 2px solid #000000

      &.active
        > a
          border-bottom: none
          border-left: 2px solid #000000

.navbar-main, .navbar-secondary, .navbar-main-additional, .navbar-secondary-additional
  .navbar-title
    padding: 12px 20px 13px 20px

.navbar-main
  .navbar-title-job
    padding: 8px 20px 8px 20px
    .indicator-primary
      padding: 8px 0 0 0
    .no-padding
      padding: 0
    .no-margin
      margin: 0
    .job-name
      font-size: 14px
    .job-id
      color: #999
      font-size: 11px

livechart
  width: 30%
  height: 30%
  text-align: center

@import './job'
@import './graph'
@import './timeline'
@import './metric'

@media (min-width: 1024px) and (max-width: 1279px)
  #sidebar
    left: 0
    width: sidebar-width-small

    .navbar-static-top
      .navbar-brand-text
        display: none

  #content
    margin-left: sidebar-width-small

    #fold-button
      display: none

    .navbar-main, .navbar-main-additional
      left: sidebar-width-small

  .table
    td.td-long
      width: 20%

@media (min-width: 1280px)
  #sidebar
    left: 0

  #content
    margin-left: sidebar-width

    #fold-button
      display: none

    .navbar-main, .navbar-main-additional
      left: sidebar-width

  .table
    td.td-long
      width: 30%

.legend-box
  font-size: 10px
  width: 2em

#total-mem
  background-color: #7cb5ec

#heap-mem
  background-color: #434348

#non-heap-mem
  background-color: #90ed7d

.show-pointer
  cursor: pointer

#fetch-plan
  width: 100px

#job-submit
  width: 100px

#content-inner
  height: 100%

#job-panel
  overflow-y: auto

#details
  height: 100%

#node-details
  height: 100%
  
